package cn.lijida.weiwei.favor.modules.guest.controller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestAttribute;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import cn.lijida.weiwei.favor.commons.constant.Conf;
import cn.lijida.weiwei.favor.commons.utils.ReturnT;
import cn.lijida.weiwei.favor.commons.validator.AddGroup;
import cn.lijida.weiwei.favor.modules.guest.entity.FavorGuest;
import cn.lijida.weiwei.favor.modules.guest.service.IFavorGuestService;

/**
 * <p>
 * 宾客 前端控制器
 * </p>
 *
 * @author jobob
 * @since 2019-12-28
 */
@RestController
@RequestMapping("/guest/center")
public class FavorGuestController {
	
	@Autowired
	private IFavorGuestService guestService;

	@PostMapping("guest")
	public ReturnT<String> create(@RequestBody @Validated({AddGroup.class}) FavorGuest guest,@RequestAttribute(Conf.LOGIN_ID) Long loginId) throws Exception{
		
		guestService.create(guest,loginId);
		return ReturnT.SUCCESS;
	}
}
